<?php

namespace IDock\Insurance\HBIC\Response;

use IDock\Http\Response;
use IDock\Printer\UnderwritingRecallPrinter;
use IDock\Printer\UploadFilePrinter;

class CancelOrderResponse extends AllHBICResponse
{

    public function printerInit(): Response
    {
        $underwritingRecallPrinter = new UnderwritingRecallPrinter();

        $this->printer = $underwritingRecallPrinter;

        $data = $this->get('body',[]);
        if($data['status'] != '0000'){
            $underwritingRecallPrinter->isSuccess = false;
            $underwritingRecallPrinter->errorTip = $data['message'];
            $this->setError($data['message']);
            $this->printer = $underwritingRecallPrinter;
            return $this;
        }

        $underwritingRecallPrinter->isSuccess = true;
        $this->printer = $underwritingRecallPrinter;
        return $this;
    }
}